package com.algorithm.Acm;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class NoK {
    private int n;
    private int k;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        System.out.println(n+" "+k);
        Random r = new Random();
        int[] array=new int[n];
        for(int i=0;i<n;i++){
            array[i]=r.nextInt(100000);
        }
        Arrays.sort(array);
        for(int i=0;i<n;i++){
            System.out.print(array[i]+" ");
        }
        System.out.println();
        System.out.print(array[k-1]);
    }
}
